package com.shqcjd.yunweiyanoperator.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.yunweiyanoperator.R;
import com.shqcjd.yunweiyanoperator.model.pojo.CollectionBean;
import com.shqcjd.yunweiyanoperator.model.pojo.StaffManageBean;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class CollectionAdapter extends BaseQuickAdapter<CollectionBean.ListBean, CollectionAdapter.ViewHolder> {
    private Context context;

    public CollectionAdapter(@Nullable List<CollectionBean.ListBean> data, Context context) {
        super(R.layout.item_collection, data);
        this.context = context;
    }

    @Override
    protected void convert(ViewHolder helper, CollectionBean.ListBean item) {
        helper.tvCollectionName.setText(item.userName);
        helper.tvCollectionTitle.setText(item.title);
        helper.tvCollectionTime.setText(item.createTime);
        helper.tvCollectionUp.setText("点赞数:"+item.likeNum);
        helper.tvCollection.setText("收藏数:"+item.collectNum);
    }

    class ViewHolder extends BaseViewHolder {
        @BindView(R.id.tv_collection_title)
        TextView tvCollectionTitle;
        @BindView(R.id.tv_collection_name)
        TextView tvCollectionName;
        @BindView(R.id.tv_collection_time)
        TextView tvCollectionTime;
        @BindView(R.id.tv_collection_up)
        TextView tvCollectionUp;
        @BindView(R.id.tv_collection)
        TextView tvCollection;
        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
